'''
3 100
18 15 10
75 72 45
'''
from dataclasses import dataclass
from functools import total_ordering


@dataclass
@total_ordering
class Good:
    stock: int
    price: float
    suoha: int

    def __lt__(self, other):
        return self.price < other.price

    def __eq__(self, other):
        return self.price == other.price


n, need = map(int, input().split())
stocks = []
prices = []
if n != 0:
    stocks = list(map(int, input().split()))
    prices = list(map(int, input().split()))
if need >= sum(stocks):
    print('%.2f' % sum(prices))
    exit(0)

goods = [Good(stocks[i], prices[i] / stocks[i], prices[i]) for i in range(n)]
goods.sort(reverse=True)
cost = 0
for i in goods:
    if need >= i.stock:
        cost += i.suoha
        need -= i.stock
    else:
        cost += need * i.price
        break

print('%.2f' % cost)
